package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SeekerPdfRelation;
import com.ruoyi.system.service.ISeekerPdfRelationService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 求职者pdf简历信息管理Controller
 *
 * @author ruoyi
 * @date 2024-06-28
 */
@RestController
@RequestMapping("/system/seeker_pdf")
public class SeekerPdfRelationController extends BaseController
{
    @Autowired
    private ISeekerPdfRelationService seekerPdfRelationService;

    /**
     * 查询求职者pdf简历信息管理列表
     */
    @PreAuthorize("@ss.hasPermi('system:seeker_pdf:list')")
    @GetMapping("/list")
    public TableDataInfo list(SeekerPdfRelation seekerPdfRelation)
    {
        startPage();
        List<SeekerPdfRelation> list = seekerPdfRelationService.selectSeekerPdfRelationList(seekerPdfRelation);
        return getDataTable(list);
    }

    /**
     * 导出求职者pdf简历信息管理列表
     */
    @PreAuthorize("@ss.hasPermi('system:seeker_pdf:export')")

    @PostMapping("/export")
    public void export(HttpServletResponse response, SeekerPdfRelation seekerPdfRelation)
    {
        List<SeekerPdfRelation> list = seekerPdfRelationService.selectSeekerPdfRelationList(seekerPdfRelation);
        ExcelUtil<SeekerPdfRelation> util = new ExcelUtil<SeekerPdfRelation>(SeekerPdfRelation.class);
        util.exportExcel(response, list, "求职者pdf简历信息管理数据");
    }

    /**
     * 获取求职者pdf简历信息管理详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:seeker_pdf:query')")
    @GetMapping(value = "/{seekerId}")
    public AjaxResult getInfo(@PathVariable("seekerId") Long seekerId)
    {
        return success(seekerPdfRelationService.selectSeekerPdfRelationBySeekerId(seekerId));
    }

    /**
     * 新增求职者pdf简历信息管理
     */
    @PreAuthorize("@ss.hasPermi('system:seeker_pdf:add')")

    @PostMapping
    public AjaxResult add(@RequestBody SeekerPdfRelation seekerPdfRelation)
    {

        return toAjax(seekerPdfRelationService.insertSeekerPdfRelation(seekerPdfRelation));
    }

    /**
     * 修改求职者pdf简历信息管理
     */
    @PreAuthorize("@ss.hasPermi('system:seeker_pdf:edit')")

    @PutMapping
    public AjaxResult edit(@RequestBody SeekerPdfRelation seekerPdfRelation)
    {

        return toAjax(seekerPdfRelationService.updateSeekerPdfRelation(seekerPdfRelation));
    }

    /**
     * 删除求职者pdf简历信息管理
     */
    @PreAuthorize("@ss.hasPermi('system:seeker_pdf:remove')")

    @DeleteMapping("/{seekerIds}")
    public AjaxResult remove(@PathVariable Long[] seekerIds)
    {
        return toAjax(seekerPdfRelationService.deleteSeekerPdfRelationBySeekerIds(seekerIds));
    }
}
